// To parse this JSON:
//
//   NSError *error;
//   QTRealResult *realResult = [QTRealResult fromJSON:json encoding:NSUTF8Encoding error:&error];

#import <Foundation/Foundation.h>

@class QTRealResult;
@class QTBody;
@class QTHead;

NS_ASSUME_NONNULL_BEGIN

#pragma mark - Object interfaces

/// 实时成绩
@interface QTRealResult : NSObject
/// 头部数据
@property (nonatomic, strong) QTHead *head;
/// 主体数据
@property (nonatomic, strong) QTBody *body;

+ (_Nullable instancetype)fromJSON:(NSString *)json encoding:(NSStringEncoding)encoding error:(NSError *_Nullable *)error;
+ (_Nullable instancetype)fromData:(NSData *)data error:(NSError *_Nullable *)error;
- (NSString *_Nullable)toJSON:(NSStringEncoding)encoding error:(NSError *_Nullable *)error;
- (NSData *_Nullable)toData:(NSError *_Nullable *)error;
@end

/// 主体数据
@interface QTBody : NSObject
/// 代表队/代表团/俱乐部
@property (nonatomic, copy) NSString *team;
/// 运动员姓名
@property (nonatomic, copy) NSString *athleteName;
/// 运动员号码
@property (nonatomic, copy) NSString *athleteBib;
/// 运动员联系方式
@property (nonatomic, copy) NSString *athleteTelephone;
/// A线成绩
@property (nonatomic, copy) NSString *resultA;
/// B线成绩
@property (nonatomic, copy) NSString *resultB;
/// 排名
@property (nonatomic, copy) NSString *rank;
@end

/// 头部数据
@interface QTHead : NSObject
/// 设备Id
@property (nonatomic, copy) NSString *deviceID;
/// 消息Uuid
@property (nonatomic, copy) NSString *messageUUID;
/// 发送消息的时间。格式：yyyy-MM-dd HH:mm:ss.fff 比如：2020-09-02 12:24:09.923
@property (nonatomic, copy) NSString *timestamp;
/// 消息类型
@property (nonatomic, copy) NSString *messageType;
@end

NS_ASSUME_NONNULL_END
